package org.simple.wechat.demo.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.simple.wechat.demo.config.IEnumDeserializer;
import org.simple.wechat.demo.ienum.IEnum;
import org.simple.wechat.demo.ienum.IEnumAnnotation;

/***
 * @author gaoqijin
 * @date 2020-9-10
 * @Description
 */
@IEnumAnnotation.NotFoundMsg("快递类型不明确")
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
@JsonDeserialize(using = IEnumDeserializer.class)
public enum ExpressEnum implements IEnum {

  SF_ORDER(11,"顺丰快递"),
  STO_ORDER(12,"申通快递"),
//  @IEnumAnnotation.DefaultEnum
  ZTO_ORDER(13,"中通快递"),
  YTO_ORDER(9,"圆通快递")
  ;
  private  int code;
  private String desc;
  ExpressEnum(int code,String desc){
    this.code = code;
    this.desc = desc;
  }
  ;
  @Override public int getCode() {
    return this.code;
  }

  @Override public String getDesc() {
    return this.desc;
  }

  @Override public String getName() {
    return name();
  }
}
